package com.example.viewpager_fragment

import android.content.Context
import android.view.MotionEvent
import androidx.viewpager.widget.ViewPager
import androidx.viewpager2.widget.ViewPager2

class CustomViewPager(context: Context): ViewPager(context) {
    override fun onInterceptTouchEvent(event: MotionEvent): Boolean {
        // 如果触摸点在悬浮窗区域内，不拦截事件
        if (isPointInFloatingWindow(event.rawX, event.rawY)) {
            return false
        }
        return super.onInterceptTouchEvent(event)
    }
    private fun isPointInFloatingWindow(x: Float, y: Float): Boolean {
        return true
    }
}